package org.springblogs.batch.config.stock;
import org.springblogs.batch.processor.stock.StockPriceItemProcessor;
import org.springblogs.dao.StockInfoRepository;
import org.springblogs.model.StockInfo;
import org.springblogs.model.StockPrice;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Component;

@Component
public class StockPriceBatchJob extends AbstractRepositoryBatchJob<StockInfo, StockPrice> {
    @Autowired
    private StockInfoRepository readRepository;
    @Autowired
	private StockPriceItemProcessor processor;
    
	@Override
	protected ItemProcessor<StockInfo, StockPrice> processor() {
		return processor;
	}

	@Override
	public PagingAndSortingRepository<StockInfo, ?> getReadRepository() {
		return readRepository;
	}
}